package com.ashin.exception;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

public class GlobalException {


    @ExceptionHandler()
    public ModelAndView globalEx(Exception e) {
        ModelAndView mv = new ModelAndView();
        mv.setViewName("testException");
        mv.addObject(e.getMessage()+"ddd");

        return mv;
    }

}
